package com.esm.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.esm.service.RemoveRecordService_zxk;
import com.esm.serviceimpl.RemoveRecordServiceImpl_zxk;

import net.sf.json.JSONObject;

/**
 * 删除出差记录 Controller
 * @author 康少
 *
 * 2017年1月5日
 */
public class RemoveBtravelController_zxk extends HttpServlet{
	RemoveRecordService_zxk remove = new RemoveRecordServiceImpl_zxk();
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doPost(req, resp);
	}
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
		int att_id = Integer.parseInt(req.getParameter("att_id"));
		boolean flag = remove.RomoveBtravel(att_id);
		JSONObject j = new JSONObject();
		j.put("flag", flag);
		PrintWriter pw = resp.getWriter();
		pw.write(j.toString());
		pw.flush();
		pw.close();
	}
}
